% Pure copie du package prettyref.sty dans $TEXMFDIR/tex/latex/misc/
\ProvidesPackage{myprettyref}[2001/08/08 v3.1]
\RequirePackage{color}

\newcommand{\ccl}[2]{\textcolor{#1}{#2}}

\def\newrefformat#1#2{
  \@namedef{pr@#1}##1{#2}}
\newrefformat{eq}{(\textup{(\ccl{red}{\ref{#1}})})}
\newrefformat{lem}{(\ccl{blue}{Lemme} \ccl{red}{\ref{#1}})}
\newrefformat{thm}{(\ccl{blue}{Theorème} \ccl{red}{\ref{#1}})}
\newrefformat{cha}{(cf. \ccl{blue}{Chap.} \ccl{red}{\ref{#1}})}
\newrefformat{sec}{(cf. \ccl{blue}{Sect.} \ccl{red}{\ref{#1}})}
\newrefformat{tab}{(cf.
  \ccl{blue}{\textsc{Tab.}~\ccl{red}{\ref{#1}}
    -~p.~\ccl{red}{\pageref{#1}}~-})}
\newrefformat{fig}{(cf.
  \ccl{blue}{\textsc{Fig.}~\ccl{red}{\ref{#1}}
    -~p.~\ccl{red}{\pageref{#1}}~-})}
\def\myprettyref#1{\@myprettyref#1:}
\def\@myprettyref#1:#2:{
  \expandafter\ifx\csname pr@#1\endcsname\relax
    \PackageWarning{myprettyref}{Format de Reference #1\space non défini.}
    \ref{#1:#2}
  \else
    \csname pr@#1\endcsname{#1:#2}
  \fi
}
\endinput
